package com.Model;

import java.util.List;

import com.UI.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class FacultyHoursAdapter extends ArrayAdapter<String>{
	private List<String> facHours;

    public 	FacultyHoursAdapter(Context context, int textViewResourceId, List<String> records) {
            super(context, textViewResourceId, records);
            this.facHours = records;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
            View facHoursView = convertView;
            if (facHoursView == null) {
            	LayoutInflater facHoursViewInflator = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

                facHoursView = facHoursViewInflator.inflate(R.layout.faculty_hours_row, null);
            }
            String selection = facHours.get(position);
            if (selection != null) {
                    TextView facultyID = (TextView) facHoursView.findViewById(R.id.facID);
                    facultyID.setTextAppearance( getContext(), R.style.SpecialText );
                    
                    if (facultyID != null) {
                    	facultyID.setText(selection);                            }

            }
            return facHoursView;
    }
    
}
